package com.sl.au.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import com.sl.au.entity.AfterSaleOutHouse;
import com.sl.au.repository.AfterSaleOutHouseRepository;
import com.sl.au.service.AfterSaleAssessService;

@Service("AfterSaleAssessService")
public class AfterSaleAssessServiceImpl extends BaseServiceImpl implements AfterSaleAssessService {

	@Autowired
	AfterSaleOutHouseRepository afterSaleOutHouseRepository;
	@Override
	public AfterSaleOutHouseRepository getRepository() {
		return this.afterSaleOutHouseRepository;
	}
	@Override
	public List<AfterSaleOutHouse> getAssessByKey(int start, int length, String key, String orderName, String dir) {
		Page<AfterSaleOutHouse> pages = null;
		Pageable pageable = new PageRequest(start / length, length, Sort.Direction.DESC, "createTime");
		pages = afterSaleOutHouseRepository.getTicketAssessByKey(key,pageable);
		return pages.getContent();
	}
 
}
